package jp.lab1;
import org.geed.testbed.sub1.FooPacket;


public class SecureNode {
	private String name = null;
	private byte[] secret = null;
	private String seq = null;
	private String rand = null;
	private int requestPort = 0;
	private String ipAddr = null;
	private boolean registered = false;
	private boolean waitconfirm = false;
	private String groupkeyID = null;
	private long waitTime = 0;
	private FooPacket confirmPkg;
	
	private String lastMessage = null;
	
	//PKI
	private byte[] sessionKey = null;
	
	
	
	
	public boolean isRegistered() {
		return registered;
	}

	public void setRegistered(boolean registered) {
		this.registered = registered;
	}

	public String getIpAddr() {
		return ipAddr;
	}

	public void setIpAddr(String ipAddr) {
		this.ipAddr = ipAddr;
	}

	public SecureNode(){
		this.name = "untitled";
	}
	
	public SecureNode(String name){
		this.name = name;
	}
	
	public String getName(){
		return this.name;
	}
	
	public void setSecret(byte[] secretBytes){
		this.secret = secretBytes;
	}
	
	public byte[] getSecret(){
		return this.secret;
	}

	public String getSeq() {
		return seq;
	}

	public void setSeq(String seq) {
		this.seq = seq;
	}

	public String getRand() {
		return rand;
	}

	public void setRand(String rand) {
		this.rand = rand;
	}

	public int getRequestPort() {
		return requestPort;
	}

	public void setRequestPort(int requestPort) {
		this.requestPort = requestPort;
	}

	public String getgroupkeyID() {
		return groupkeyID;
	}

	public void setgroupkeyID(String secretID) {
		this.groupkeyID = secretID;
	}

	public String getLastMessage() {
		return lastMessage;
	}

	public void setLastMessage(String lastMessage) {
		this.lastMessage = lastMessage;
	}

	public long getWaitTime() {
		return waitTime;
	}

	public void setWaitTime(long waitTime) {
		this.waitTime = waitTime;
	}

	public FooPacket getConfirmPkg() {
		return confirmPkg;
	}

	public void setConfirmPkg(FooPacket confirmPkg) {
		this.confirmPkg = confirmPkg;
	}

	public boolean isWaitconfirm() {
		return waitconfirm;
	}

	public void setWaitconfirm(boolean waitconfirm) {
		this.waitconfirm = waitconfirm;
	}

	public byte[] getSessionKey() {
		//System.out.println("Node = "+getName()+" session key is get");
		return sessionKey;
	}

	public void setSessionKey(byte[] sessionKey) {
		//System.out.println("Node = "+getName()+" session key is set");
		this.sessionKey = sessionKey;
		/*
		int len = sessionKey.length;
		this.sessionKey = new byte[len];
		for(int i=0; i<len; i++){
			this.sessionKey[i] = sessionKey[i];
		}*/
		
	}
	
	
	
	
}
